﻿CREATE TABLE [dbo].[ProductInCategories] (
    [ProductID]  INT NOT NULL,
    [CategoryID] INT NOT NULL,
    PRIMARY KEY CLUSTERED ([ProductID] ASC, [CategoryID] ASC),
    CONSTRAINT [FK_product_in_category_product_categories] FOREIGN KEY ([CategoryID]) REFERENCES [dbo].[ProductCategories] ([ID]) ON DELETE CASCADE,
    CONSTRAINT [FK_product_in_category_products] FOREIGN KEY ([ProductID]) REFERENCES [dbo].[Products] ([ID]) ON DELETE CASCADE
);

